// 添加字符(暴力枚举)
#include <iostream>
#include <string>
using namespace std;

int main()
{
    string a, b;
    cin >> a >> b;
    int m = a.size(), n = b.size();
    int res = 51;
    for (int i = 0; i <= n - m; i++)
    {
        int cnt = 0;
        for (int j = 0; j < m; j++)
        {
            if (a[j] != b[i + j]) cnt++;
        }
        res = min(res, cnt);
    }
    cout << res << endl;
    return 0;
}

// 数组变换(位运算)
#include <iostream>
using namespace std;

int arr[51];
int n, m;

bool func()
{
    for (int i = 0; i < n; i++) 
    {
        if (m % arr[i]) return false;
        int x = m / arr[i];
        if (x & (x - 1)) return false;
    }
    return true;
}

int main()
{
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> arr[i];
        m = max(m, arr[i]);
    }
    if (func()) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0; 
}

// 装箱问题(01背包)
#include <iostream>
using namespace std;

int v, n;
int dp[31][20001];
int a[31];

int main()
{
    cin >> v >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= v; j++)
        {
            dp[i][j] = dp[i - 1][j];
            if (j >= a[i]) dp[i][j] = max(dp[i][j], dp[i - 1][j - a[i]] + a[i]);
        }
    }
    cout << v - dp[n][v] << endl;
    return 0;
}

#include <iostream>
using namespace std;

int v, n;
int dp[20001];
int a[31];

int main()
{
    cin >> v >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++)
        for (int j = v; j >= a[i]; j--)
            dp[j] = max(dp[j], dp[j - a[i]] + a[i]);
    cout << v - dp[v] << endl;
    return 0;
}
